package com.cqupt.mant_to_many;

import com.cqupt.newbean.Course;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface CourseMapper {
    @Select("select * from course")
    @Results({
            @Result(column = "id",property = "id"),
            @Result(column = "name",property = "name"),
            @Result(
                    property = "students",
                    javaType = List.class,
                    column = "id",
                    many = @Many(select = "com.cqupt.mant_to_many.StudentMapper.selectStudent")
            )
    })
    public List<Course> selectCourse();
}
